Skip to content

read receipts: handle implicit receipts for unread counts #3054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Jan 25, 2024

Some clients, including the timeline code handling the sending of read receipts, have the notion of an implicit read receipt. Every event that you've sent yourself implies that you've read all the events prior to yours. Both parts of the code should align on when to send read receipts, since computing unread counts precisely relies on read receipts echoed back by the server otherwise.

This patch adds a new method in the ReceiptSelector, to look for an implicit read receipt and use it, if found and it's the latest in sync order.

Also add lots of tracing trace-level logs for making remote debugging easier.

@bnjbvr bnjbvr requested a review from a team as a code owner January 25, 2024 16:00
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team January 25, 2024 16:00
@bnjbvr bnjbvr force-pushed the implicit-read-receipts branch from e6db7f2 to b5667cd Compare January 25, 2024 16:01
@bnjbvr bnjbvr changed the title read receipts: handle implicit for unread counts read receipts: handle implicit receipts for unread counts Jan 25, 2024
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (d85c7b2) 83.67% compared to head (b5667cd) 83.68%.
Report is 8 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-base/src/read_receipts.rs 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3054      +/-   ##
==========================================
+ Coverage   83.67%   83.68%   +0.01%     
==========================================
  Files         222      222              
  Lines       23288    23304      +16     
==========================================
+ Hits        19487    19503      +16     
  Misses       3801     3801              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to my eyes 🌟

@bnjbvr bnjbvr merged commit 25e4c8d into main Jan 26, 2024
@bnjbvr bnjbvr deleted the implicit-read-receipts branch January 26, 2024 09:45
@bnjbvr bnjbvr mentioned this pull request Jan 26, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants